home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / Clock / Sources / Views.fr < prev   
Encoding:
Text File  |  1996-09-17  |  3.4 KB  |  127 lines  |  [TEXT/CWIE]

  1. //========================================================================================
  2. //
  3. //    File:                Views.fr
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Contains:            Common (Platform independent) resources for the Clock part
  7. //
  8. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef FWRESFIL_K
  13. #include "FWResFil.k"
  14. #endif
  15.  
  16. #ifndef FWVIEWS_FR
  17. #include "FWViews.fr"
  18. #endif
  19.  
  20. #ifndef DEFINES_K
  21. #include "Defines.k"
  22. #endif
  23.  
  24. //========================================================================================
  25. // type RClockView
  26. //========================================================================================
  27.  
  28. type RAnalogClockView : FW_RView(Label='ANVW')
  29. {
  30. };
  31.  
  32. //========================================================================================
  33. // type RClockView
  34. //========================================================================================
  35.  
  36. type RDigitalClockView : FW_RView(Label='DGVW')
  37. {
  38. };
  39.  
  40. //========================================================================================
  41. // Constants
  42. //========================================================================================
  43. // Reference size for the Clock frame (will be adjusted at runtime)
  44. #define H     FW_FIX(1000)
  45. #define H1     H + FW_FIX(1)
  46.  
  47. #define ZERO     FW_FIX(0)
  48.  
  49. //========================================================================================
  50. // resource RClockFrame(kClockView)
  51. //========================================================================================
  52. // See constants in "FWViews.k", macros & resource types in "FWViews.fr"
  53.  
  54. resource FW_RFrameLayout(kAnalogClockViewRoot)
  55. {
  56.     {H,H},                    // LayoutSize
  57.     {                        // Start list of frame's subviews
  58.         RAnalogClockView
  59.         (
  60.             kClockViewID,                        // View id
  61.             {ZERO, ZERO, H, H},                    // Bounds
  62.             FW_kFitToEnclosure                    // bindings
  63.         ),
  64.         FW_RGrowBox
  65.         (
  66.             kGrowBoxID,                            // View id
  67.             {H - FW_SBSIZE, H - FW_SBSIZE, H1, H1},    // Bounds
  68.             FW_kGrowBoxBinding                    // standard grow box binding
  69.         )
  70.     },
  71.     {} // No Scroller
  72. };
  73.  
  74. resource FW_RFrameLayout(kDigitalClockViewRoot)
  75. {
  76.     {H,H},                    // LayoutSize
  77.     {                        // Start list of frame's subviews
  78.         RDigitalClockView
  79.         (
  80.             kClockViewID,                        // View id
  81.             {ZERO, ZERO, H, H},                    // Bounds
  82.             FW_kFitToEnclosure                    // bindings
  83.         ),
  84.         FW_RGrowBox
  85.         (
  86.             kGrowBoxID,                            // View id
  87.             {H - FW_SBSIZE, H - FW_SBSIZE, H1, H1},    // Bounds
  88.             FW_kGrowBoxBinding                    // standard grow box binding
  89.         )
  90.     },
  91.     {} // No Scroller
  92. };
  93.  
  94. //-------------------------------------------------------------------------------------
  95. //  Duplicate FW_RFrameLayout resource without GrowBox for non-root frames
  96. //-------------------------------------------------------------------------------------
  97. // (See also how the Container sample avoids duplicating resources when there are
  98. //  differences between root and non-root frames)
  99.  
  100. resource FW_RFrameLayout(kAnalogClockView)
  101. {
  102.     {H,H},                    // LayoutSize
  103.     {                        // Start list of frame's subviews
  104.         RAnalogClockView
  105.         (
  106.             kClockViewID,                        // View id
  107.             {ZERO, ZERO, H, H},                    // Bounds
  108.             FW_kFitToEnclosure                    // bindings
  109.         )
  110.     },
  111.     {} // No Scroller
  112. };
  113.  
  114. resource FW_RFrameLayout(kDigitalClockView)
  115. {
  116.     {H,H},                    // LayoutSize
  117.     {                        // Start list of frame's subviews
  118.         RDigitalClockView
  119.         (
  120.             kClockViewID,                        // View id
  121.             {ZERO, ZERO, H, H},                    // Bounds
  122.             FW_kFitToEnclosure                    // bindings
  123.         )
  124.     },
  125.     {} // No Scroller
  126. };
  127.